feat(aws-serverless)!: Use GenAI span ops for Bedrock inference - #22761
feat(aws-serverless)!: Use GenAI span ops for Bedrock inference#22761msonnb wants to merge 1 commit into
Conversation
Co-Authored-By: GPT-5.6 Codex <codex@openai.com>
size-limit report 📦
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 36653f4. Configure here.
| const spanAttributes: Attributes = { | ||
| // oxlint-disable-next-line typescript/no-deprecated | ||
| [GEN_AI_SYSTEM]: GEN_AI_SYSTEM_VALUE_AWS_BEDROCK, | ||
| [SENTRY_OP]: GEN_AI_GENERATE_CONTENT_SPAN_OP, |
There was a problem hiding this comment.
GenAI span ops missing prefix
High Severity
Bedrock spans set sentry.op to bare chat / generate_content, but every other GenAI integration in this SDK uses gen_ai.chat / gen_ai.generate_content. Core GenAI handling (extractGenAiSpansFromEvent, hasGenAiSpans, conversation ID attachment) keys off the gen_ai. prefix, so these inference spans stay misclassified and miss GenAI-specific processing.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 36653f4. Configure here.
| @@ -39,6 +40,7 @@ function assertBedrockSpans(transaction: TransactionEvent): void { | |||
| // InvokeModel (non-streaming, anthropic.claude request/response body) | |||
| expect(spans, 'expected a Bedrock InvokeModel span').toContainEqual( | |||
| expect.objectContaining({ | |||
| op: 'generate_content', | |||
There was a problem hiding this comment.
m: Hm, we typically prefix these with gen_ai., I don't know enough about bedrock but maybe we can align here with the other ai instrumentations?
| [key: string]: any; | ||
| } | ||
|
|
||
| const GEN_AI_GENERATE_CONTENT_SPAN_OP = 'generate_content'; |
There was a problem hiding this comment.
q: Do we have a task to add this to sentry conventions?


Use
chatfor Bedrock Converse spans andgenerate_contentfor InvokeModel spans instead of genericrpc, so inference calls are classified by their GenAI operation.Part of #22446